package com.jie.controller;

import com.jie.pojo.AttenceZibiao;
import com.jie.pojo.Schedule;
import com.jie.service.AttenceZiBiaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/zibiao")
public class AttenceZiBiaoController {

    @Autowired
    private AttenceZiBiaoService attenceZiBiaoService;

    @RequestMapping("/insertRecord")
    @ResponseBody
    public Boolean insertRecord(HttpServletRequest request, AttenceZibiao attenceZibiao) throws Exception {

        Boolean IsSuccess = attenceZiBiaoService.insertRecord(attenceZibiao);
        return IsSuccess;
    }

    @RequestMapping("/getAttenceRecord")
    @ResponseBody
    public List<AttenceZibiao> findAttenceRecord(HttpServletRequest request, String classid) throws Exception {

        List<AttenceZibiao> attenceZibiaoList = attenceZiBiaoService.findAttenceRecord(classid);
        return attenceZibiaoList;
    }
}
